<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
	if($_RQ['op']=='edit'){
	$item=$this->plugin_setting('setting');
    $return['item']=$item;
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'设置',
		'edits'=>array(
				array(
					'title'=>'基本信息',
					'list'=>array(
						array('type'=>'switch','title'=>'是否要审核','name'=>'peisong_auto',),
						array('type'=>'radio','title'=>'配送佣金模式','name'=>'peisong_commission_type','options'=>'peisong_commission_types'),
						array('type'=>'string','title'=>'每单佣金','name'=>'peisong_fee','show'=>array('peisong_commission_mode1'=>0)),
						array('type'=>'string','title'=>'提现费率设置','name'=>'peisong_rate'),
						array('type'=>'string','title'=>'配送员同时接单数量','name'=>'peisong_order_max'),
						array('type'=>'string','title'=>'定时推送下单时间大于多少秒的单子','name'=>'peisong_msgnotice_time'),
						array('type'=>'string','title'=>'自动完成已配送后多少秒的订单','name'=>'peisong_msgnotice_finish'),
						array('type'=>'radio','title'=>'下单配送通知','name'=>'peisong_messagetype','options'=>'peisong_messagetypes'),
					)
				),
			)
	);
	$return['htmls']=$htmls;
	set_html('framess',$this->menu());
	$return['peisong_commission_types']=array('0'=>'以每单计算','1'=>'以每件商品计算');
	$return['peisong_messagetypes']=array('0'=>'不通知','1'=>'所有配送员','2'=>'最近配送点');
	exi($return);
	}
if($_RQ['op']=='post'){
		$postdata=get_postdata();
		$data=array(
			'peisong_auto'=>trim($postdata['peisong_auto']),
			'peisong_commission_type'=>trim($postdata['peisong_commission_type']),
			'peisong_fee'=>ijson_encode($postdata['peisong_fee']),
			'peisong_rate'=>ijson_encode($postdata['peisong_rate']),
			'peisong_order_max'=>ijson_encode($postdata['peisong_order_max']),
			'peisong_msgnotice_time'=>trim($postdata['peisong_msgnotice_time']),
			'peisong_msgnotice_finish'=>trim($postdata['peisong_msgnotice_finish']),
			'peisong_messagetype'=>trim($postdata['peisong_messagetype']),
		);
		$item=$this->plugin_setting('setting',$data);
		exi('设置成功');
}
?>